import request from '@/utils/requist'

// 筛选条件-地址
export const getRegion = () => {
  return request({
    method: 'get',
    url: '/api/portraits/industry/getRegion'
  })
}

export const Overview = ({ project_type }) => {
  return request({
    method: 'post',
    url: '/api/project/Overview',
    data: {
      project_type
    }
  })
}
export const ProjectMap = ({ district_name }) => {
  return request({
    method: 'post',
    url: '/api/project/ProjectMap',
    data: {
      district_name
    }
  })
}
export const StatisticAnalysis = ({ flag, district }) => {
  return request({
    method: 'post',
    url: '/api/project/StatisticAnalysis',
    data: {
      flag, district
    }
  })
}
export const AuditProjectFile = (
  { project_id,
    token,
    file_type,
    audit_status,
    audit_message,
    project_level }
) => {
  return request({
    method: 'post',
    url: '/api/project/AuditProjectFile',
    data:
    {
      project_id,
      token,
      file_type,
      audit_status,
      audit_message,
      project_level
    }
  })
}
export const AuditProjectFile2 = (formData) => {
  return request({
    method: 'post',
    url: '/api/project/AuditProjectFile2',
    data: formData
  })
}

export const EditClassScore = ({
  class_name,
  class_score1,
  class_score2,
  class_score3,
  class_score4
}) => {
  return request({
    method: 'post',
    url: '/api/project/EditClassScore',
    data: {
      class_name,
      class_score1: parseFloat(class_score1),
      class_score2: parseFloat(class_score2),
      class_score3: parseFloat(class_score3),
      class_score4: parseFloat(class_score4)
    }
  })
}

export const EditDistrictScore = ({
  district_name,
  district_score1,
  district_score2,
  district_score3,
  district_score4,
  district_score5,
  district_score6,
  district_score7,
  district_score8
}) => {
  return request({
    method: 'post',
    url: '/api/project/EditDistrictScore',
    data: {
      district_name,
      district_score1: parseFloat(district_score1),
      district_score2: parseFloat(district_score2),
      district_score3: parseFloat(district_score3),
      district_score4: parseFloat(district_score4),
      district_score5: parseFloat(district_score5),
      district_score6: parseFloat(district_score6),
      district_score7: parseFloat(district_score7),
      district_score8: parseFloat(district_score8)
    }
  })
}
export const EditUnitScore = ({
  unit_name,
  unit_score1,
  unit_score2,
  unit_score3,
  unit_score4,
  unit_score5,
}) => {
  return request({
    method: 'post',
    url: '/api/project/EditUnitScore',
    data: {
      unit_name,
      unit_score1: parseFloat(unit_score1),
      unit_score2: parseFloat(unit_score2),
      unit_score3: parseFloat(unit_score3),
      unit_score4: parseFloat(unit_score4),
      unit_score5: parseFloat(unit_score5),
    }
  })
}
export const EditOverseasScore = ({
  offices_name,
  offices_score1,
  offices_score2,
  offices_score3,
}) => {
  return request({
    method: 'post',
    url: '/api/project/EditOverseasScore',
    data: {
      offices_name,
      offices_score1: parseFloat(offices_score1),
      offices_score2: parseFloat(offices_score2),
      offices_score3: parseFloat(offices_score3),
    }
  })
}
export const EditServiceDepartmentScore = ({
  department_name,
  department_score1,
  department_score2,
  department_score3,
  department_score4,
}) => {
  return request({
    method: 'post',
    url: '/api/project/EditServiceDepartmentScore',
    data: {
      department_name,
      department_score1: parseFloat(department_score1),
      department_score2: parseFloat(department_score2),
      department_score3: parseFloat(department_score3),
      department_score4: parseFloat(department_score4),
    }
  })
}
export const ClassDropDownBox = () => {
  return request({
    method: 'get',
    url: '/api/project/ClassDropDownBox',
  })
}
export const ScoreRank = ({ flag }) => {
  return request({
    method: 'post',
    url: '/api/project/ScoreRank',
    data: {
      flag
    }
  })
}
export const GetInputData = ({ flag, name }) => {
  return request({
    method: 'post',
    url: '/api/project/GetInputData',
    data: {
      flag, name
    }
  })
}
export const MyProject = ({ token }) => {
  return request({
    method: 'post',
    url: '/api/project/MyProject',
    data: {
      token
    }
  })
}
export const WaitToDo = ({ token, select_type }) => {
  return request({
    method: 'post',
    url: '/api/project/WaitToDo',
    data: {
      token, select_type
    }
  })
}
// 我的项目  --- 待办事项 --- 待提交
export const WaitCommit = ({ token, page,
  per_page }) => {
  return request({
    method: 'post',
    url: '/api/project/WaitCommit',
    data: {
      token,
      page,
      per_page
    }
  })
}
// 我的项目  --- 待办事项 --- 待审核
export const WaitAudit = ({ token, page,
  per_page }) => {
  return request({
    method: 'post',
    url: '/api/project/WaitAudit',
    data: {
      token,
      page,
      per_page
    }
  })
}
// 我的项目  --- 待办事项 --- 待提交
export const WaitUpdate = ({ token, page,
  per_page }) => {
  return request({
    method: 'post',
    url: '/api/project/WaitUpdate',
    data: {
      token,
      page,
      per_page
    }
  })
}
// 我的项目  --- 待办事项 --- 督办通知
export const GetNoticeLog = ({ token,
  page,
  per_page }) => {
  return request({
    method: 'post',
    url: '/api/project/GetNoticeLog',
    data: {
      token,
      page,
      per_page
    }
  })
}

// 我的项目  --- 待办事项 --- 历史记录
export const WaitHistory = ({ token, page,
  per_page }) => {
  return request({
    method: 'post',
    url: '/api/project/WaitHistory',
    data: {
      token,
      page,
      per_page
    }
  })
}

// 我的项目  --- 我的评分
export const MyGrade = ({ token }) => {
  return request({
    method: 'post',
    url: '/api/project/MyGrade',
    data: {
      token
    }
  })
}

export const CheckNotice = ({ notice_id }) => {
  return request({
    method: 'post',
    url: '/api/project/CheckNotice',
    data: {
      notice_id
    }
  })
}

